import java.io.*;
import java_cup.runtime.*;
import java.net.URL;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;

public class process 
{
	static List<String> lista=new ArrayList<String>();
	static List<String> completas = new ArrayList<String>();
	public static String dominio="";
	public static void add(String e)
	{
		if(lista.indexOf(e)==-1 && completas.indexOf(e)==-1)
			lista.add(e);
	}
	public static void comenzar() throws Exception
	{
		while(lista.size()>0)
		{
			String value=lista.remove(0);
			try {
				if(value.indexOf(dominio)!=-1)
					proceso(value);
			} catch (Exception e) {}
			completas.add(value);
		}
	}
	static void proceso(String link) throws Exception
	{
		URL myURL = new URL(link);

		BufferedReader so = new BufferedReader(new InputStreamReader(myURL.openStream()));
		while (true) {
		      String output = so.readLine();
		      if (output != null) {
			try {   
			InputStream is = new ByteArrayInputStream( output.getBytes( "ISO-8859-1" ) );
			parser p = new parser(new Yylex(is));
			p.parse();
			}
			catch (Exception e) { }
		      } else {
			break;
		      }
		    }
		so.close();

	}
}
